package co.edu.unal.geditor.view.controlpoints;

import java.awt.Cursor;
import java.awt.Point;

import co.edu.unal.geditor.controller.App;
import co.edu.unal.geditor.model.BoundBox;

public class RightUpControlPoint extends ControlPoint {
	public RightUpControlPoint(){
		
	}

	public RightUpControlPoint(Point point, int ControlPointDimension) {
		super(point, ControlPointDimension);
	}

	public RightUpControlPoint(Point point) {
		super(point);
	}

	@Override
	public void changeCursor() {
		App.getInstance().getCanvas().setCursor(new Cursor(Cursor.NE_RESIZE_CURSOR));

	}

	@Override
	public void resizing(Point cursorPosition, BoundBox modifiedBoundBox) {
		if(cursorPosition.x>modifiedBoundBox.getLeftUp().x && cursorPosition.y < modifiedBoundBox.getRightDown().y){
			modifiedBoundBox.setLeftUp(new Point(modifiedBoundBox.getLeftUp().x,cursorPosition.y));
			modifiedBoundBox.setRightDown(new Point(cursorPosition.x,modifiedBoundBox.getRightDown().y));
		}
		
	}

}
